Dependent types Mechanization backend#215
Draft
DCupello1 wants to merge 3 commits into
Draft
Conversation
DCupello1
commented
Feb 23, 2026
| (match Num.cvt nt2 n with | ||
| | Some n' -> NumE n' $> e | ||
| | None -> e1' | ||
| | None -> CvtE (e1', _nt1, nt2) $> e |
Author
There was a problem hiding this comment.
@rossberg quick question on this change.
This makes the frontend fail with this issue:
[valid_exp] x
test.spectec:197.30-197.31: validation error: expression's type `val($pppp((3 : nat <:> int), (4 : nat <:> int)))` = `val($pppp(+3, +4))` does not equal expected type `val((7 : nat <:> int))` = `val(+7)`
Which feels like it should not fail since it is able to convert successfully. Do you might know why this would happen?
Collaborator
There was a problem hiding this comment.
Ah, this looks like a sensible bug fix. This causes failure because it was masking another bug, which is that match_exp is missing a case for handling CvtE.
I just pushed a fix.
47ed238 to
c4c5faf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an experimental branch that does the following:
Currently a draft until we figure out testing in this case.